<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	srcCd			= Request("srcCd")
	input				= Request("input")
	output			= Request("output")
	issuedMemo	= Request("issuedMemo")
	issuedDt		= Request("issuedDt")
	seq				= Request("seq")
	flag				= Request("flag")

	If input = "" Then input = 0 End If 
	If output = "" Then output = 0 End If 
	If seq = "" Then seq = 0 End If 

	issuedMemo		= Replace(issuedMemo,"'","''")
	issuedId = Request.Cookies("S_uid")
	
	SQLTitle = "-- ■■■■ 원자재 관리 정보 저장 ■■■■"
	SQL = "exec spSrcInOut '" & srcCd & "', " & input & ", " & output & ", '" & issuedMemo & "', '" & issuedDt & "', '" & issuedId & "', '" & flag & "', " & seq

	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

'Response.write SQL
'Response.end
	DbCon.Execute SQL

	'## 원자재 총 소모량
	orgSrcCnt = aFieldValue("SELECT SUM(output) orgSrcCnt FROM tblSrcInOut WHERE issuedMemo= '" & issuedMemo & "' AND flag='Y'")

	Call rsWithXML2("Save OK!",orgSrcCnt)
%>